Skip to content

feat(tool): add Synthetic web search backend to websearch tool - #41160

Open
Qiiks wants to merge 1 commit into
anomalyco:devfrom
Qiiks:pr/synthetic-websearch
Open

feat(tool): add Synthetic web search backend to websearch tool#41160
Qiiks wants to merge 1 commit into
anomalyco:devfrom
Qiiks:pr/synthetic-websearch

Conversation

@Qiiks

@Qiiks Qiiks commented Aug 7, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #41164

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds "synthetic" as a third web search backend alongside exa and parallel:

  • WebSearchProviderSchema gains "synthetic"; selectWebSearchProvider handles it (env override + flag + checksum fallback)
  • callProvider POSTs to https://api.synthetic.new/v2/search with Bearer auth and formats results (url/title/text)
  • enableSynthetic runtime flag — auto-enabled when SYNTHETIC_API_KEY is set, or explicitly via OPENCODE_ENABLE_SYNTHETIC_SEARCH=1
  • webSearchEnabled and webSearchProviderLabel extended

Auth follows the existing parallel pattern: the tool resolves the key from the auth store (opencode auth login for a synthetic provider) with a fallback to the SYNTHETIC_API_KEY env var.

How did you verify your code works?

  • New tests for routing, env override, and label — websearch.test.ts: 12 pass / 0 fail.
  • bun run typecheck clean.
  • End-to-end: OPENCODE_WEBSEARCH_PROVIDER=synthetic opencode run --model ... "Search the web for: what is bun runtime" returned real formatted results from Synthetic's /v2/search (exit 0). Also verified auto-enablement via auth-store key (no env var) works.

Screenshots / recordings

N/A (no UI change)

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Adds 'synthetic' as a third web search provider alongside exa and
parallel. Enabled when the synthetic provider is authed (auth store)
or SYNTHETIC_API_KEY env is set. POSTs to
https://api.synthetic.new/v2/search with Bearer auth and returns
formatted results with url/title/text.
Copilot AI lite review requested due to automatic review settings August 7, 2026 23:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Aug 7, 2026
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add Synthetic web search backend to websearch tool

2 participants